<template>
    <!-- 首页-八字篇 -->
    <div class="home-container">
        <div class="card-item">
            <div class="module-title">基础理法</div>
            <div class="button-list">
                <div class="button" @click="toTextPage('hanzao')">寒燥</div>
                <div class="button" @click="toTextPage('yao')">君臣杂药</div>
            </div>
            <div class="button-list">
                <div class="button" @click="toTextPage('chonghe')">冲合</div>
                <div class="button"
                    @click="showImage(['https://mp-aac0e8f6-ad5a-4992-aecf-d590a570f6a9.cdn.bspapp.com/cloudstorage/6371c250-afe6-4a7b-a947-dcea79208fcc.png'])">
                    生旺墓绝</div>
            </div>
            <div class="button-list">
                <div class="button"
                    @click="showImage(['https://mp-aac0e8f6-ad5a-4992-aecf-d590a570f6a9.cdn.bspapp.com/cloudstorage/6ea2bd02-13ca-4e14-a94c-315cb0481414.webp']);">
                    地支藏气</div>
            </div>
            <div class="button-list">
                <div class="button" @click="router.push({ path: '/bazi/library/shenSha' });">神煞</div>
            </div>
        </div>

        <div class="card-item">
            <div class="module-title">练习</div>
            <div class="button-list">
                <div class="button" @click="router.push('/bazi/cangqiTest')">藏气练习</div>
            </div>
        </div>

        <div class="card-item">
            <div class="module-title">技法归纳</div>
            <div class="button-list">
                <div class="button" @click="router.push({ path: '/bazi/library/tgItemDetail' });">日主天干个性状况</div>
            </div>
            <div class="button-list">
                <div class="button" @click="toTextPage('bazi')">杂谈</div>
            </div>
        </div>

        <div class="card-item">
            <div class="module-title">其他</div>
            <div class="button-list">
                <div class="button"
                    @click="showTips('1.中国命理学史论\n2.神秘的命运密码-中国相术与命学\n3.中国古代星占学\n4.滴天髓\n5.三命通会\n6.穷通宝鉴\n7.神峰通考\n8.渊海子平\n9.子平真诠\n10.八字命例集')">
                    推荐书籍
                </div>
            </div>
        </div>

        <div class="jump-text" @click="router.push({ path: '/liuyao' });">六爻篇 ></div>

        <div class="beian">
            <a href="https://beian.miit.gov.cn/">备案号</a>
            <a href="https://beian.miit.gov.cn/">豫ICP备2023010781号-1</a>
        </div>
    </div>
</template>

<script setup>
import { showImage, showTips } from '@utils';
import { useRouter } from 'vue-router';

const router = useRouter();

function toTextPage(key) {
    router.push({
        path: '/other/text',
        query: {
            key: key
        }
    });
}
</script>

<style lang="scss" scoped>
.card-item {
    background-color: #ffffff;
    margin: .5rem .5rem 0;
    border-radius: .4rem;
    padding: .5rem 0 .375rem;
}

.module-title {
    width: 100%;
    color: #D3AE78;
    font-size: .75rem;
    text-align: center;
    margin-bottom: .25rem;
}

.button-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 .25rem;
}

.button {
    width: 100%;
    height: 2.5rem;
    background-color: #f2f2f2;
    border-radius: .2rem;
    color: #000000;
    text-align: center;
    line-height: 2.5rem;
    margin: .25rem;
    font-size: .75rem;
}

.jump-text {
    color: #2EBCF1;
    font-size: .65rem;
    width: 100%;
    text-align: center;
    padding: 1rem;
}

.beian {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.beian a:-webkit-any-link {
    color: #666666;
    font-size: .6rem;
    opacity: 0.5;
}
</style>